package mylist
{
	import flash.display.Sprite;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.events.KeyboardEvent;
	import flash.filters.GlowFilter;
	import flash.text.TextField;
	import flash.text.TextFormat;
	
	public class logs extends Sprite
	{
		public static var txt:TextField = new TextField();
		
		public function logs()
		{
			txt.addEventListener(Event.ADDED_TO_STAGE, init);
			addChild(txt);
			adds("@author: db0@qq.com");
		}
		
		public static function init(e:Event):void
		{
			txt.filters = [new GlowFilter()];
			txt.mouseEnabled = false;
			txt.selectable = false;
			//txt.visible = false;
			txt.width = txt.stage.stageWidth;
			txt.height = txt.stage.stageHeight;
			txt.multiline = true;
			//txt.textColor = 0xffffff;
			//txt.background = true;
			txt.wordWrap = true;
			txt.scrollV = txt.maxScrollV;
		}
		
		static public function show():void
		{
			txt.visible = !(txt.visible);
		}
		
		private static var line:int = 0;
		
		public static function adds(str:*, ... other):void
		{
			txt.defaultTextFormat = new TextFormat(null, 25);
			if (txt.stage)
				txt.stage.addChild(logs.txt);
			//txt.appendText("\n" +(++line) + ":" +str);
			txt.appendText("\n" + String(str));
			for each (var item:*in other)
			{
				txt.appendText("," + String(item));
			}
			
			trace(str, other);
			txt.scrollV = txt.maxScrollV;
		}
	}

}